// DicManager.h: interface for the CDicManager class.
//
//////////////////////////////////////////////////////////////////////
//#include <sapi.h>           // SAPI includes
//#include <sphelper.h>
//#include <spuihelp.h>

#include "..\DicModule.h"
#if !defined(AFX_DICMANAGER_H__D4A2B59E_C19B_49D7_B2CE_A5867B7981F5__INCLUDED_)
#define AFX_DICMANAGER_H__D4A2B59E_C19B_49D7_B2CE_A5867B7981F5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CDicManager  
{
public:
	static CDicManager* Instance();
	BOOL InitManager();
public:	
	BOOL CreateShowMeaningFile(const CString strWord, const CString strFileName);
	void SetGetWordType(UINT nType);
	BOOL CreateShowSegFile(const CString strSent, const CString strFileName);
	BOOL CreateShowSegFileOrg(const CString strSent, const CString strFileName);
	BOOL CreateShowMeaningFileOrg(const CString strWord, const CString strFileName);
	void SoundPlay(CString strWord);
	DicModule* GetModule(const CString& strWord);
    BOOL CDicManager::GetStrListInShow(const CString& strSent, CString& strWord,CStringList &strList,int i,CPoint& point,CRect& WordRect);
 
	BOOL GetPreWord(const CString strWord, CString &strNextWord);
	BOOL GetNextWord(const CString strWord,CString& strNextWord);
	HMODULE m_hmCE;
	DicHeader* m_pCEHeader;
	DicModule* m_pCurCEModule;

	HMODULE m_hmEC;
	DicHeader* m_pECHeader;
	DicModule* m_pCurECModule;
    void ClearInstance();
	GetDicHeader_Type m_pfnGetDicHeader ;
	virtual ~CDicManager();
protected:
	CDicManager();
private:
	BOOL InitECDic(CString strLibName);
	BOOL InitCEDic(CString strLibName);

//    CComPtr<ISpVoice>   m_cpVoice;
	
	bool IsChar(char a);	
	static CDicManager* m_instance;
	static const CString strCELib;
	static const CString strECLib;
};

#endif // !defined(AFX_DICMANAGER_H__D4A2B59E_C19B_49D7_B2CE_A5867B7981F5__INCLUDED_)
